Efficient synthesis of repeat-until-success circuits in clifford + t basis

ABSTRACT

Repeat-Until-Success (RUS) circuits are compiled in a Clifford+T basis by selecting a suitable cyclotomic integer approximation of a target rotation so that the rotation is approximated within a predetermined precision. The cyclotomic integer approximation is randomly modified until a modified value can be expanded into a single-qubit unitary matrix by solving one or more norm equations. The matrix is then expanded into a two-qubit unitary matrix of special form, which is then decomposed into an optimal two-qubit Clifford+T circuit. A two-qubit RUS circuit using a primary qubit and an ancillary qubit is then obtained based on the latter decomposition. An alternate embodiment is disclosed that keeps the total T-depth of the derived circuit small using at most 3 additional ancilla qubits. Arbitrary unitary matrices defined over the cyclotomic field of 8th roots of unity are implemented with RUS circuits.

FIELD

The disclosure pertains to decomposition of quantum circuits in aClifford+T basis.

BACKGROUND

One objective of compilation systems for quantum computing is thedecomposition of any required single-qubit unitary operation into setsof gates that can implement arbitrary single-qubit unitary operations.Typically, gate sets that provide fault tolerance are preferred. Onegate set that has been identified is referred to as the {H,T} gate setthat includes the Hadamard gate and the T-gate. This gate set isuniversal for single-qubit unitaries (can realize arbitrary single-qubitunitary operations to required precision) and is fault tolerant.

The {H,T} gate set has been used to implement circuits, but historicallyresulting circuits had excessive cost. Significant progress has beenmade in the last two years in reducing the cost, but there is ample roomfor improvement. It has been shown that adding ancillary qubit(s), atwo-qubit gate (for example, CNOT or CZ), and measurement operations tothe gate set can result in lower cost computation. One approach is basedon so-called Repeat-Until-Success (RUS) circuits in which an intendedoutput state can be identified using a measurement of an ancillary qubitand a sequence of Clifford+T gates, where the Clifford+T gate setincludes the two-qubit CNOT gate (or CZ gate), the Hadamard gate, andthe T-gate. Paetznick and Svore, “Repeat-Until-Success:Non-deterministic decomposition of single-qubit unitaries,”available athttp://arxiv.org/abs/1311.1074 , describe methods for implementingrotations using the Clifford+T gates in combination with measurementsand classical feedback. The RUS method achieves superior computationcost. However, these methods are based on an exhaustive search andrequire exponential runtime. Thus, these methods are limited inachievable precision and hence in applicability.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

Methods and apparatus are disclosed that permit decomposition of quantumcomputational circuits such as rotation gates into series of Clifford+Tgates using one or more ancillary qubits. Typically, a single-qubitunitary is obtained by finding a cyclotomic integer z such that z*/z isrational and corresponds to the selected rotation within a desiredprecision. The cyclotomic integer z is then modified so as to solve anorm equation, and the modified or scaled value of z is used to definethe single-qubit unitary in the Clifford+T basis. This intermediatesingle-qubit unitary is then expanded into a larger two-qubit unitarywhich serves as the basis of the circuit design. A Clifford+Tdecomposition of this two-qubit unitary is arranged as aRepeat-Until-Success (RUS) circuit in which a state associated with anancillary qubit is measured to determine if the intended circuitoperation has been realized on a primary qubit. If not, the primaryqubit is restored to an initial state, and RUS circuit operations arerepeated.

The foregoing and other features, and advantages of the invention willbecome more apparent from the following detailed description, whichproceeds with reference to the accompanying figures.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a compilation method that synthesizes arepeat-until-success (RUS) circuit over a Clifford+T basis forimplementing an axial rotation R_(z) (θ) to a precision ε>0.

FIG. 2 illustrates a random search method for obtaining values for asingle-qubit unitary matrix.

FIG. 3 illustrates a method of obtaining a unitary matrix implementablein a Clifford+T basis.

FIG. 4 illustrates a representative RUS circuit.

FIG. 5 illustrates a method of obtaining a two-qubit unitary matrix.

FIG. 6 shows T-count statistics for 1000 target rotation angles randomlyselected from the interval (0,π/2) .

FIG. 7 shows T-count statistics for 40 rotation angles of the formπ/2^(k), k=2, . . . , 41.

FIG. 8 illustrates a representative method of producing a multiple qubitRUS circuit.

FIG. 9 is a block diagram of a representative computing environment inwhich the disclosed methods can be implemented.

FIG. 10 is a block diagram of a representative computing environmentthat includes classical and quantum processing.

FIG. 11 illustrates a method for implementing RUS circuits using 2ancillas with total circuit depth equal to the circuit depth of rotationU.

FIG. 12 illustrates a method for implementing arbitrary unitarytransformations with coefficients over the field of cyclotomic rationalsQ(ω) using at most 2 ancillas.

DETAILED DESCRIPTION

As used in this application and in the claims, the singular forms “a,”“an,” and “the” include the plural forms unless the context clearlydictates otherwise. Additionally, the term “includes” means “comprises.”Further, the term “coupled” does not exclude the presence ofintermediate elements between the coupled items.

The systems, apparatus, and methods described herein should not beconstrued as limiting in any way. Instead, the present disclosure isdirected toward all novel and non-obvious features and aspects of thevarious disclosed embodiments, alone and in various combinations andsub-combinations with one another. The disclosed systems, methods, andapparatus are not limited to any specific aspect or feature orcombinations thereof, nor do the disclosed systems, methods, andapparatus require that any one or more specific advantages be present orproblems be solved. Any theories of operation are to facilitateexplanation, but the disclosed systems, methods, and apparatus are notlimited to such theories of operation.

Although the operations of some of the disclosed methods are describedin a particular, sequential order for convenient presentation, it shouldbe understood that this manner of description encompasses rearrangement,unless a particular ordering is required by specific language set forthbelow. For example, operations described sequentially may in some casesbe rearranged or performed concurrently. Moreover, for the sake ofsimplicity, the attached figures may not show the various ways in whichthe disclosed systems, methods, and apparatus can be used in conjunctionwith other systems, methods, and apparatus. Additionally, thedescription sometimes uses terms like “produce” and “provide” todescribe the disclosed methods. These terms are high-level abstractionsof the actual operations that are performed. The actual operations thatcorrespond to these terms will vary depending on the particularimplementation and are readily discernible by one of ordinary skill inthe art.

In some examples, values, procedures, or apparatus' are referred to as“lowest”, “best”, “minimum,” or the like. It will be appreciated thatsuch descriptions are intended to indicate that a selection among manyused functional alternatives can be made, and such selections need notbe better, smaller, or otherwise preferable to other selections.

In some examples, the terms “unitary” or “unitary matrix” are used torefer to functions performed by quantum circuits that can be implementedin a variety of ways. In the following description, such matrices arealso referred to as circuits for convenient description. Some commonlyused quantum gates corresponding to single-qubit operators S, X, Y, andZ can be represented as:

$S = \begin{bmatrix}1 & 0 \\0 & \end{bmatrix}$ ${X = \begin{bmatrix}0 & 1 \\1 & 0\end{bmatrix}},{Y = \begin{bmatrix}0 & {- } \\ & 0\end{bmatrix}},{Z = {\begin{bmatrix}1 & 0 \\0 & {- 1}\end{bmatrix}.}}$

Compilation of high-level quantum algorithms into lower-levelfault-tolerant circuits is a critical component of quantum computation.One fault-tolerant universal quantum basis, referred to as theClifford+T basis, consists of the two-qubit Controlled-NOT gate (CNOT),and two single-qubit gates, the Hadamard gate (H) and the T-gate T. Theoperation of these gates can be written as:

${CNOT} = \begin{pmatrix}1 & 0 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & 0 & 0 & 1 \\0 & 0 & 1 & 0\end{pmatrix}$ ${H = {\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\1 & {- 1}\end{bmatrix}}},{and}$ $T = {\begin{bmatrix}1 & 0 \\0 & ^{\frac{\pi}{4}}\end{bmatrix}.}$

These circuits can be combined to implement an arbitrary unitaryoperation. A one-qubit unitary operator can be expressed as a unitary2×2 matrix with complex elements:

$\begin{bmatrix}a & b \\{- b^{*}} & a^{*}\end{bmatrix},$

wherein a and b are complex numbers and the notation “x*” indicates acomplex conjugate of x. Such a unitary 2×2 matrix U has the followingproperty:

${{U^{\dagger}U} = {{UU}^{\dagger} = {I = \begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}}}},{wherein}$ $U^{\dagger} = {\begin{bmatrix}a^{*} & {- b} \\b^{*} & a\end{bmatrix}.}$

The adjoint U¹ of a unitary matrix U is the complex-conjugate transposeof the unitary U and is the inverse of U, denoted U⁻¹.

While circuits can be compiled using the Clifford+T basis, compilationusing conventional techniques as in Paetznick and Svore can requireexhaustive searches and exponential classical runtimes. Alternativecompilation methods, apparatus, and associated circuits based on theClifford+T basis are disclosed herein. In typical examples describedbelow, a few ancillary qubits and a few measurement operations are usedalong with purely unitary circuits.

A unitary operation is representable by a Clifford+T circuit if and onlyif the unitary operation is represented by a unitary matrix of the form1/√{square root over (2)}^(k)U where U is a matrix with elements from□[ω] and k is a non-negative integer. □[ω] is a ring of cyclotomicintegers of order 8, and consists of all numbers of the formaω³+bω²+cω+d wherein a,b,c,d are arbitrary integers and ω=_(e) ^(ix/4).One choice for a basis of □[ω] is {ω³ω²,ω,1}. To be unitary,UU^(†)=2^(k) Id ,where Id is an identity matrix. A matrix of such formcan be represented as an asymptotically optimal Clifford+T circuit usingat most two ancillary qubits. In other representations, no ancillaryqubits are required for a single-qubit subject unitary or whenDet(1/√{square root over (2)}^(k)U)=1. Any single-qubit circuit in the{H,T} basis can be expressed as a sequence of syllables of the formT^(−k)HT^(k),k∈□ and at most one additional single-qubit Clifford gate.Any single-qubit unitary operation U can be decomposed into a sequenceof axial rotations U=R_(z)(a) R_(x)(β) R_(z)(γ) in accordance with theEuler angle decomposition of U. Thus any single-qubit unitary operationcan be decomposed using the techniques presented herein.

T-gates are much harder to perform in a fault-tolerant manner than anyof the Clifford gates. In most architectures, a T-gate requires aso-called fault-tolerant “magic state” which is more than an order ofmagnitude harder to distill for typical quantum error correcting codesthan a fault-tolerant Hadamard gate H. The T-gate can be up to twoorders of magnitude harder to perform than a CNOT gate or any of thePauli gates. Accordingly, a cost measure for a Clifford+T circuit (aT-count) is a number of T-gates in a circuit and this cost measure inused in the following description.

With reference to FIG. 1, a compilation method 100 is provided thatsynthesizes a repeat-until-success (RUS) circuit over a Clifford+T basisfor implementing an axial rotation R_(z)(θ) to a precision ε>0 . At 102,a rotation angle and a precision are selected. At 104, a phase factore^(iθ) is approximated with a unimodal cyclotomic rational, i.e., withan algebraic number of the form z*/z wherein z∈□[ω]. A suitableapproximation procedure based on solving an integer relation problem isdiscussed below. The value of z is defined up to an arbitraryreal-valued factor. In general, a selected z-value may not be includablein a unitary matrix of the form

$\frac{1}{{\sqrt{2}}^{L}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}$

that is exactly representable in the Clifford+T basis.

At 106, several rounds of random modification z

(rz),r∈□[√{square root over (2)}] are performed in search of r such that(a) the norm equation |y|²2^(L)−|rz|² is solvable for y∈□[ω],L∈□ and (b)the one-round success probability |rz|²/2^(L) is sufficiently closeto 1. Suitable procedures are described below. At 108, the value of z ismodified and at 110, a corresponding one-qubit circuit is defined. At112, a two-qubit RUS matrix based on the one-qubit circuit is defined.At 114, a desired two-qubit RUS circuit in the Clifford+T basis issynthesized that implements the R_(z)(θ) rotation on success and aneasily correctable Clifford gate on failure. While a Clifford gate basedcircuit is convenient for implementation of a correction operation, acorrection circuit can include T-gates as well. At 116, a circuitspecification for the rotation R_(z)(θ) is output. Exampleimplementations of these steps are described in further detail below.

Cyclotomic Rational Approximation

As shown in FIG. 1, at 104, an initial approximation of e^(iθ) isobtained such that z*/z□e^(iθ), wherein z is a cyclotomic integer. For aselected real θ and a cyclotomic integer z=aω³+bω²+cω+d,a,b,c,d∈□,|z*/z−e^(iθ)|≦ε if and only if: |a(cos(θ/2)−sin(θ/2))+b√{square rootover (2)}cos(θ/2)+c(cos(θ/2)+sin(θ/2))+d√{square root over(2)}sin(θ/2)|<ε|z|

Thus e^(iθ) is representable exactly only if ε|z|=0. If ε|z| is small,then |z*/z−e^(iθ)| is small as well. An integer relation algorithm canbe used to find a relation between a set of real numbers and a candidatevector defined by a set of integers a₁, . . . , a_(n), not all zero,such that:

a _(i) x ₁ + . . . +a _(n) x _(n)=0.

Most commonly an integer relation algorithm makes iterative attempts tofind an integer relation until the size of the candidate vector a₁, . .. , a_(n) exceeds a certain pre-set bound or a₁x₁+ . . . +a_(n)x_(n)falls below a selected resolution level. Such an algorithm can be usedto reduce the size of a₁x₁+ . . . +a_(n)x_(n) to an arbitrarily smallvalue.

In one example, a so-called PSLQ relation algorithm is used to find aninteger relation between (cos(θ/2)−sin(θ/2), √{square root over (2)}cos(θ/2),(cos(θ/2)+sin(θ/2)),√{square root over (2)}sin(θ/2) and terminatesif and only if |z*/z−e^(iθ)|<ε. (The PSLQ algorithm is described in, forexample, Helaman R. P. Ferguson and David H. Bailey, “A Polynomial Time,Numerically Stable Integer Relation Algorithm,” RNR Technical ReportRNR-91-032 (Jul. 14, 1992), which is incorporated herein by reference.)Upon termination, the algorithm also provides the integer relationcandidate vector {a,b,c,d} for which the integer relation is satisfied.Then, z=aω³+bω²+cω+d is the desired cyclotomic integer.

Lifting Phase Approximation to a Unitary: Randomized Search

Upon finding a cyclotomic integer z, the value of z is to be included ina unitary matrix of the form:

${\frac{1}{{\sqrt{2}}^{L}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}},$

wherein y∈□[ω],L∈□. In addition, reasonably large values of |z|²/2^(L)are associated with one-round success probability of an eventual RUScircuit and are thus preferred. It is not clear that a particular valueof z can be included in a unitary matrix such as shown above. A value ofy∈□[ω] is needed that satisfies a norm equation (|y|²+|z|²)/2^(L)=1, or,alternatively |y|²=2^(L)−|z|².

To solve the above norm equation, it is convenient to note that thecyclotomic integer z obtained from a cyclotomic rational approximationof e^(iθ) is not unique, but is defined up to an arbitrary real-valuedfactor r∈□[√{square root over (2)}]. For any such r, (rz)*/(rz) isidentical to z*/z but the norm equation |y|²=2^(L)−|rz|² can changedramatically. Thus, if suitable values of r are reasonably dense in□[√{square root over (2)}], random values of r can be selected until thenorm equation |y|²=2^(L)−|rz|² is solvable. Selection of a particularvalue of y (and a particular unitary matrix) can be based on a ratio ofcircuit complexity (for example, T-count) and a probability of circuitsuccess, wherein the probability of circuit success can be expressed asp(r)=|rz|²/2^(L). Thus, a suitable value of r can be found and the valueof z modified so that (rz)*/(rz)□e^(iθ). With this modification of z, ay value can be obtained by solving the norm equation, and a single-qubitunitary defined.

Referring to FIG. 2, a method 200 of defining a unitary includesreceiving a cyclotomic integer z=aω³+bω²+cω+d such that z*/z□e^(iθ)andreceiving a number sz of samples of r to be evaluated at 202. At 204, asample space S_(M) from which r-values are to be randomly selected isdefined as S_(M←{a+b)√{square root over (2)},a,b∈□|0<a²+b²<M²}, whereinM is a sampling radius. Sample spaces of other shapes can be used, but asampling radius M is convenient. At 206, a value of r is randomlyselected without replacement from the sample space S_(M), and at 208 anassociated value of L is determined as L_(r)←j log₂(|rz|²)k, wherein j fk is a ceiling function having a value equal to the smallest integerthat is greater than f. At 210, the norm equation |y|²=2^(L)′−|rz|² isevaluated to determine if it is easily solvable for the selected valueof r. If the norm equation is not easily solvable, the method 200determines if additional samples are to be evaluated at 220. If easilysolvable, a value of y is obtained at 212 and a merit function isevaluated at 214 to determine if this value of y is preferable topreviously obtained values. A representative merit function tc is aratio of circuit T-count to probability of success p, i.e.,

$\left. {tc}\leftarrow{{{Tcount}\left\lbrack {\frac{1}{{\sqrt{2}}^{L_{r}}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}} \right\rbrack}/{p.}} \right.$

Upon computation of the merit function tc at 214, the computed value iscompared with a value associated with a previous estimate of y at 216.If the value of the merit function is less than that associated with theprevious estimate, stored values of r and y and the associated meritfunction value are updated at 218. It is then determined if additionalsamples of r are to be tried at 220. If the merit function found to havenot been decreased at 216, then it is determined if additional samplesof r are to be tried at 220 as well. If so additional samples are to beevaluated, an additional random value of r is obtained at 206 and theprocessing steps are repeated with this value of r. Otherwise, values ofr and y are output at 222. In some instances, no suitable values of rare found, and the lack of suitable values is output instead at 222.Generally, if no values are found (i.e., Y=none), the procedure isrepeated by reducing the value of precision by, for example, reducingthe value by a factor of 2.

A particular merit function is used in the example of FIG. 2 and isbased on a function:

${Tcount} = {{{Tcount}\left\lbrack {\frac{1}{{\sqrt{2}}^{L_{r}}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}} \right\rbrack}.}$

Methods of determination and/or estimation of a number of T-gates (i.e.,circuit T-count) for a unitary as shown above are well known. However,other types of merit functions can be used based on one or more ofT-count, success probability, or other factors. The T-count function isdescribed in, for example, Bocharov and Svore, “A Depth-OptimalCanonical Form for Single-Qubit Quantum Circuits,” available athttp://arxiv.org/abs/1206.3223, and Gossett et al., “An algorithm forthe T-count,” available at http://arxiv.org/abs/1308.4134. Methodssimilar to the method of FIG. 2 are shown in greater detail in thepseudo-code for the procedures RAND-NORMALIZATION of Tables 1-2 below.

TABLE 1 Random Normalization (z, sz, M) Input: z ∈

 [w], sample size sz, M 1: procedure RAND-NORMALIZATION(z, sz, M) 2: cnt ← 0, Y ← None, Tc ← ∞ 3:  S_(M) ← {a + b {square root over (2)}, a,b ∈

|0 < a² + b² < M²} 4:  while (cnt ++) ≦ sz do 5:   Sample r withoutreplacement from S_(M) 6:   L_(r) ← ┌log₂(|r z|²)┐ 7:   if |y|² = 2^(L)^(r) − |r z|² is easily solvable then 8:    p ← |r z|²/2^(L) ^(r) 9:    $\left. {tc}\leftarrow{{Tcount}\; {\left( {\frac{1}{{\sqrt{2}}^{L_{r}}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}} \right)/p}} \right.$ 10:    if tc < Tc then 11:     Tc ←tc, Y ← {r, y} 12:    end if 13:   end if 14:  end while 15: endprocedure

An alternative procedure is shown in Table 2 below. In this alternativeprocedure, a minimum success probability p_(min) is input along with aselected value of z and a sample radius M. The function card(S_(M)) isthe cardinality of the set S_(M).

TABLE 2 Random Normalization (z, p_(min), M) Input: z ∈

[ω], minimum success probability p_(min), M 1: procedureRAND-NORMALIZATION(z, p_(min), M) 2:  cnt ← 0, Y ← None, Tc ← ∞ 3: S_(M) ← {a + b {square root over (2)}, a, b ∈

|0 < a² + b² < M²} 4:  while (cnt ++) ≦ card(S_(M)) do 5:   Sample rwithout replacement from S_(M) 6:   L_(r) ← ┌log₂(|r z|²)┐ 7:   if |y|²= 2^(L) ^(r) − |r z|² is easily solvable then 8:    p ← |r z|²/2^(L)^(r) 9:    $\left. {tc}\leftarrow{{Tcount}\; {\left( {\frac{1}{{\sqrt{2}}^{L_{r}}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}} \right)/p}} \right.$ 10:    if p > p_(min) and tc < Tcthen 11:     Tc ← tc, Y ← {r, y} 12:    end if 13:   end if 14:  endwhile 15: end procedure

Single-Qubit Circuit Synthesis

FIG. 3 illustrates a method 300 of defining a single-qubit circuit basedon a selected rotation angle θ, a precision ε, a number of iterationssz, and a sampling radius M that are input at 302. At 304, a value ofthe precision is re-assigned, and at 306 a procedure for findingparameters for the corresponding unitary matrix is initiated. At 308, asuitable cyclotomic integer is found, and at 310 a random search/normequation solution procedure such as those of Tables 1-2 is implemented.If a suitable value of Y={r,y} is found, a value of L is computed at314, and the required unitary matrix is defined at 316. Pseudocode forsuch a method is shown in Table 3 below.

TABLE 3 Single-Qubit Circuit Determination Input: angle θ, targetprecision ε, sample size sz, hyperparameter M 1: procedureSINGLE-QUBIT-DESIGN(θ, ε, sz) 2:  ret ← None, ∈ ← 2ε 3:  while ret =None do 4:   ∈ ← ∈/2 5:   Compute z ∈

[ω] s.t. |z*/z − e^(iθ)| < ∈ 6:   Y ← RAND − NORMALIZATION(z, sz) 7:  if Y ≠ None then 8:    r ← first(Y); y ← last(Y) 9:    L ←log₂(|rz|² + |y|²) 10:    $\left. {ret}\leftarrow{\frac{1}{{\sqrt{2}}^{L}}\; \begin{pmatrix}{rz} & y \\{- y^{*}} & {rz}^{*}\end{pmatrix}} \right)$ 11:   end if 12:  end while 13: end procedure

Repeat-Until-Success Unitary Circuit Synthesis

With the above methods, a single-qubit unitary matrix for the rotationR(θ) in the Clifford+T basis is found of the form:

${V = {\frac{1}{{\sqrt{2}}^{L}}\begin{pmatrix}z & y \\{- y^{*}} & z^{*}\end{pmatrix}}},$

wherein y, z∈□(ω),L∈□. The unitary matrix V can be represented as anancilla-free circuit in the single-qubit Clifford+T basis using aprocedure described by Kliuchnikov et al., “Fast and efficient exactsynthesis of single qubit unitaries generated by Clifford and T gates,”arXiv:12065236v4 (Feb. 27, 2013), which is incorporated herein byreference. The unitary matrix V can be decomposed by other methods aswell. To find a two-qubit (RUS) circuit (i.e., with an ancilla), definea two-qubit unitary

$U = {\begin{pmatrix}V & 0 \\0 & V^{\dagger}\end{pmatrix}.}$

This two-qubit unitary can be incorporated into a RUS circuit with oneancilla so as to

$\begin{pmatrix}1 & 0 \\0 & {z^{*}/z}\end{pmatrix}\quad$

perform the rotation on a primary qubit on success and the Pauli Zoperation on failure. The unitary matrix V that is included in U can beincorporated into a two-qubit Repeat-Until-Success (RUS) circuit withone ancillary qubit, such that the circuit performs the rotation

$\begin{pmatrix}1 & 0 \\0 & {z^{*}/z}\end{pmatrix}\quad$

upon success and a Pauli Z operator on failure, wherein

$Z = {\begin{pmatrix}1 & 0 \\0 & {- 1}\end{pmatrix}.}$

For example, for a two-qubit design where qubit 1 is a primary qubit andqubit 2 is an ancillary qubit initialized with |0

, if |Ψ

=a|0

+b|1

is the input state on the primary qubit then U(|Ψ

|1

) is proportional to za|00

−y*a|01

+z*b|10

+y*b|11

. Therefore upon measuring the ancillary qubit, if the measurementresult is 0, then the output state is equivalent to a|0

+(z*/z)b|1

(i.e., success) and if the measurement result is 1 then the output stateis equivalent to a|0

−b|1

(i.e., failure).

A representative RUS circuit 400 with an ancillary qubit 402 isillustrated in FIG. 4. The ancillary qubit 402 is initialized in a state|0

and is coupled to an RUS circuit 406 along with a primary qubit 404 in astate |Ψ

=a|0

+b|1

. At 408, an output state of the ancillary qubit 408 is measured. If themeasurement of the ancillary qubit 402 is 0, the output state of theprimary qubit corresponds to a|0

+(z*/z)b|1

which is associated with the selected rotation (referred to as“success”). If the output state of the ancillary qubit is 1, then theoutput state of the primary qubit 404 is a|0

−b|1

, which does not correspond to the intended rotation operator (referredto as “failure”). In this case, the primary qubit 404 is coupled to asubsequent two-qubit circuit 414 having an ancillary qubit 409 that isinitialized to state |0

. The primary qubit 404 is coupled to a Z gate 412 that produces a state|ω

=a|0

+b|1

which is the same as the original input state to the RUS circuit 406 sothat the Z gate 412 reverses the operation of the RUS circuit 406. Theprocessing operations of the two-qubit circuit 414 can be repeated untilsuccess is achieved. The second RUS circuit 416 provides similar resultsat the RUS circuit 406 upon measurement at 418. Additional similarstages such as circuit 420 can be provided to increase the likelihood ofsuccess.

The two-qubit unitary U can be implemented as a series of Clifford+Tgates but implementations in which circuit T-count is the same or onlyslightly greater than that of the corresponding optimal single qubitcircuit are preferred. If V and W are single-qubit unitaries bothrepresentable by single-qubit ancilla-free Clifford+T circuits of thesame minimal T-count t, then it can be shown that the two-qubit unitary

$U = \begin{pmatrix}V & 0 \\0 & W\end{pmatrix}$

is exactly and constructively representable by a Clifford+T circuit ofT-count at most t+9. Generally, given two single-qubit Clifford+Tcircuits of the same T-count, either can be manufactured from the otherby insertion and deletion of Pauli gates, along with the addition of atmost two non-Pauli Clifford gates. The latter two gates are responsiblefor all potential T-count increases while lifting the V,W pair to thedesired two-qubit circuit.

For convenience, a T code is defined as a circuit generated by TH andT^(†)H syllables. If c is a T code then Hc³¹ ¹H is a T code. A decoratedT code is a circuit generated by syllables of the form PT^(±1)QH whereinP,Q∈{Id,X,Y,Z} , and Id is an identity operator. A decorated T code c2is referred to as a decoration of a T code c₁ if c₁ can be obtained fromc2 by removing all explicit occurrences of Pauli gates. A single-qubit,ancilla-free Clifford+T circuit can be constructively rewritten in theform g₁cg₂ where c is a T code and g₁,g₂ are single-qubit Cliffordgates.

The following identities can also be useful:

XTH=T^(†)HZω

YTH=T^(†)HYω⁵

ZTH=THX

XSHTH=S^(†)HTHXω²YSHTH=S^(†)HT^(†)HYω³

ZSHTH=SHT^(†)HZω

Canonical

T, H

circuits are defined as circuits representable as arbitrary compositionsof TH and HTH syllables, and starting with a TH syllable. For any T codec₁ any single-qubit ancilla-free Clifford+T circuit c₂ of the sameT-count can be constructively rewritten as g₃c′₁g₄ where c′₁ is adecoration of c₁ and g₃, g₄ are Clifford gates. If c₁ and c₂ aresingle-qubit Clifford+T circuits of the same T-count t, a T code C₃, oneof its decorations c₄, and Clifford gates g₁,g₂,g₃,g₄ can be found suchthat c₁=g₁c₃g₂ and c₂=g₃c₄g₄.

A lift procedure is defined that converts a decorated T-code into a twoqubit circuit. For any Pauli gate P, Lift(P)=Λ(P), where Λ(P) indicatesa controlled-P gate. For any other gate g, Lift(g)=Id

g. Given a single-qubit Clifford+T circuit c=g₁ . . . g₄ whereing_(i)∈{X, Y, Z, H, T, T^(†)} i=1, . . . , r, Lift(c)=Lift(g₁) . . .Lift(g_(r)) . Informally, up to Clifford gate wrappers, any twosingle-qubit Clifford+T circuits are related via T code decoration.

If a single-qubit unitary U is represented as Hc₁ where c₁ is a T codeof T-count t, then the two-qubit unitary

$\begin{pmatrix}U & 0 \\0 & U^{\dagger}\end{pmatrix}\quad$

is constructively represented by a two-qubit Clifford+T circuit ofT-count of either t or t+1. The unitary matrix Ur can be decomposed intoHc₂ω^(k),k∈□ wherein c₂ is a decoration of the circuit c₁. Since (Hc₁)⁻¹=(c₁)⁻¹H is H followed by a T code, the desired decomposition isLift(Hc₂)(T^(k)

Id). The T-count of Lift(Hc₂) is t and the T-count of (T^(k)

Id) is either 0 or 1.

More generally, if V,W are single-qubit unitaries both representable bysingle-qubit ancilla-free Clifford+T circuits of the same minimalT-count t, then a two-qubit unitary

$U = \begin{pmatrix}V & 0 \\0 & W\end{pmatrix}$

is exactly and constructively representable by a Clifford+T circuit ofT-count of at most t+9.The unitary W can be constructively represented as g₃g₁c′g₂g₄ wherein c′is a decoration of c, and g₃, g₄ are Clifford gates. Defining c″=Lift(c′) , U can be represented as Λ(g₃)(Id

g₁)c″(Id

g₂)Λ(g₄). Each occurrence of a controlled Clifford gate increases theT-count by at most 5. By applying a suitable global phase the T-count ofΛ(g₃) is at most 4. For any Clifford gate g, the controlled gate Λ(g)can be can be represented as a product of Clifford gates and exactly onegate of the form Λ(h) wherein h∈{Id,ω⁻¹S,H,ω⁻¹SH,ω⁻¹HS}.

A representative method of obtaining a two-qubit unitary based on asingle input unitary Vis shown in FIG. 5. At 502, a single qubit unitaryV is input. At 504, V is represented as a product g₁cg₂ and at 506,V^(†) is represented as a product g₃c′g₄, wherein g₁,g₂,g₃,g₄ areClifford gates, c is a T-code, and c′ is a decoration of c. At 508,additional Clifford gates are obtained based on the Clifford gates usedin the product representations of V and V^(†). At 510, a suitable twoqubit unitary is returned as Λ(g₅)(Id

g₁)Lift(c′)(Id

g₂)Λ(g₆) . Pseudocode for this method is found in Table 3 below.

TABLE 3 Pseudocode for determining a two-qubit unitary with a primaryand an ancillary qubit. Input: single qubit unitary V 

 representable in Clifford+T  1: procedure PARSIMONIOUS-RUS-SYNTHESIS(V) 2: represent V as g₁ c g₂ where c is T code 

 g1, g2 are Clifford gates  3: represent V^(†) as g₃ c′ g₄ where c′ is adecoration of c 

g3, g4 are Clifford gates  4: g₅ ← g₃ g₁ ^(†), g₆ ← g₂ ^(†)g₄  5: ret ←Λ(g₅)(Id 

 g₁)Lift(c′)(Id 

 g₂)Λ(g₆)  6: end procedure Output: ret

EXAMPLE

Determination of a Clifford+T basis RUS circuit for a representativerotation is described below for a target rotation R_(z)(π/64) and aprecision of 10⁻¹¹. A ratio z*/z is found that approximates e^(iπ/64).In this example, z=1167ω³=218ω²31 798ω−359 and an associated precisionis about 3×10⁻¹², better than the target precision of 10⁻¹¹. Next, thevalue of z is modified using a randomized search to find a solvable normequation so that z=18390ω³−4226ω²−11614ω−1814 and a one round successprobability is 0.9885. Circuit synthesis then generates the RUS circuitdesign Λ(ω⁻¹ SH)coreΛ(ω⁻¹SH), wherein

-   -   core=id{circle around (/)}(T⁻¹ H T⁻¹ H) CNOT Id        (T⁻¹ H T H) CNOT Id        (T H T H T³¹ H) CNOT Id        (T⁻¹ H) CNOT Id        (T⁻¹ H) CNOT Id        (T⁻³ H) CNOT Id        (T⁻¹ H) CNOT Id        (T H) CNOT Id{circle around (/)}(T⁻³ H T³ H) CNOT Id        (T⁻¹ H T⁻¹ H T⁻¹ H) CNOT Id        (T H T H) CNOT Id        (T H T⁻³ H) CNOT Id{circle around (/)}(T³ H) CNOT Id        (T⁻³ H) CNOT Id        (T H T H) CNOT Id        (T⁻¹ H) CNOT Id        (T H T⁻¹ H) CNOT Id        (T⁻¹ H) CNOT Id        (T³ H) CNOT Id        (T⁻¹ H T⁻¹ H) CNOT Id        (T H T H) CNOT Id        (T⁻³ H T³ H T⁻¹ H) CNOT Id        (T H T⁻¹ H) CNOT Id        (T H) CNOT Id        (T⁻¹ H) CNOT Id        (T H) CNOT Id        (T⁻³ H) CNOT Id        (T H) CNOT T G T⁻¹ H T H CNOT Id        (T⁻¹ H T⁻¹ H) CNOT Id        (T⁻³ H S^(†))

The S-gate above corresponds to a square of the T-gate. The Λ(ω⁻¹ SH)operation has a T-count of 4 and the overall cost of the RUS circuitmeasured in T gates is 58. The expected T-cost is 58/0.9885<58.7. Thiscircuit implements a z-rotation on success and Pauli Z gate operation onfailure, which is Pauli-correctable. A final trace distance betweenR_(z)(π/64) and the rotation implemented by the RUS is 1.056×10⁻¹² whichis better than the requested precision. Another version of this circuitis Λ(ω⁻²H)core(Id

S)Λ(H), which has an expected T-cost of 54.6, performs the samez-rotation on success and the phase gate Son failure. Application of thephase gate S is Clifford-correctable.

FIGS. 6-7 show mean and standard deviation across a set of expectedT-count values of the RUS circuits generated algorithmically for eachtarget rotation in the second test set for each precision. FIG. 6 showsT-count statistics for 1000 target rotation angles randomly selectedfrom the interval (0,π/2) . This set of target axial rotations wasevaluated at 25 levels of target precision ε∈{10⁻¹¹ , . . . , 10⁻³⁵}. Aregression formula for T-count is3.817log₁₀(1/ε)+9.2=1.149log₂(1/ε)+9.2. FIG. 7 shows T-count statisticsfor 40 rotation angles of the form π/2^(k), k=2, . . . , 41. This set oftarget rotation angles (referred to as Fourier angles) was evaluated at30 levels of target precision ε∈{10⁻¹¹, . . . , 10⁻⁴⁰}. A regressionformula for T-count is 3.59log₁₀(1/ε)+17.5=1.08log₂(1/ε)+17.5.

n-Qubit RUS Circuits

Consider an n-qubit unitary of the form

$\frac{1}{z}V$

where z∈Z[√{square root over (i)}] and V is a 2^(π)×2^(π)matrix overZ[√{square root over (i)}]. This unitary can be implemented by aClifford+T RUS with at most n+2 qubits. A method 800 for finding such aunitary is shown in FIG. 8. At 802, an integer L and an r∈Z[√{squareroot over (2)}] are selected such that a norm equation |y|²=2^(L)−|rz|²is solvable for y∈Z[√{square root over (t)}]. At 804, a 2^(π+1)×2^(π)matrix

$W = {\frac{1}{{\sqrt{2}}^{L}}\begin{bmatrix}r & V \\y & {I\; d}\end{bmatrix}}$

is defined which is to be completed to a 2^(n+1)×2^(n+1) unitary matrixfollowing a procedure described in Kliuchnikov et al., “Fast andefficient exact synthesis of single qubit unitaries generated byClifford and T gates,” arXiv:12065236v4 (Feb. 27, 2013). At 806 the2^(n) columns of the matrix W are reduced to a half-basis by aClifford+T circuit c that is synthesized using a procedure described inBrett Giles and Peter Selinger, “Exact synthesis of multi-qubitClifford+T circuits,” Phys. Rev. A (2012), such that:

${cW} = \begin{pmatrix}{Id}_{2^{''}} \\0_{2^{''}}\end{pmatrix}$

It follows that c⁻¹ evaluates to a 2^(n+1)×2^(n+1) unitary matrix thatcomplements the half-square matrix W. The circuit c⁻¹ can intermittentlyuse an ancillary qubit to perform the two-level primitive unitaries ofthe T-type. In any case, c⁻¹ is the desired RUS circuit and is output at810. Indeed,

$\left. {{\left. {\left. {{{c^{- 1}\left( {{0\rangle} \otimes} \right.}\psi}\rangle} \right) = \left( {{\left. 0 \right) \otimes \left( {\frac{r}{\left( \sqrt{2} \right)^{L}}V} \right)}\psi}\rangle \right.} \right) + {\left( {{1\rangle} \otimes \left( {\frac{y}{\left( \sqrt{2} \right)^{L}}{Id}} \right)} \right.\psi}}\rangle} \right).$

The target operator

$\frac{1}{z}V$

is the unitarization of

$\frac{r}{\left( \sqrt{2} \right)^{L}}V$

and the unitarization of

$\frac{y}{\left( \sqrt{2} \right)^{L}}$

Id is Id.

Thus, when the top qubit is measured,

$\frac{1}{z}V$

is returned for a 0 measurement and Id is returned for a 1 measurement.A one-round success rate for this circuit is |rz|²/2^(L), therefore,values of L close to ┌log₂(|rz|²)┐ are preferred.

Reducing the Number of Entanglers in RUS Designs

RUS circuits synthesized as disclosed herein may include a large numberof controlled-Pauli gates. In some cases, an RUS circuit design couldcontain 2t controlled-Pauli Pauli gates wherein t is the circuitT-count. Although a controlled-Pauli gate has zero T-count, in someexamples, it is preferred to reduce the number of controlled-Pauligates. Up to one half of the Pauli gates in a circuit can beconstructively eliminated from a T-odd

T,H,Pauli

circuit using a set of signature-preserving rewrite rules. For asingle-qubit Clifford+T circuit of the form g₀T^(k) ¹ g₁, . . . , T^(k)^(r) g_(r) where g₀,g₄ are Clifford gates and for i=1, . . . , r 1wherein g_(i) ∈{Id,X,Y,Z,H,XH,YH,ZH,HX,HY,HZ}, the series of integers{k₁, . . . , k_(r)} is referred to as a signature of the circuit. Aunitary V^(†) can be represented as a Pauli decoration c′ of a circuit crepresenting V is so that the signatures of c and c′ are the same. Onlythe signature of the Pauli decoration circuit is of concern, and anyequivalent transformations can be applied to such a decoration as longas those transformations preserve the signature. If the T-count of adecorated T code c is t, then the circuit can be rewritten in a formc′i^(m),m∈□, wherein c′ is an equivalent decorated T code with no morethan t+1 Pauli gates and the same signature as c. In some cases, one ormore of the following rewrite rules is used:

Y

ω² XZXZ

ω⁻²YZX

ω²YXX

emptyZZ

emptyXH

HZZH

HXZX

ω⁴ XZZT^(m)

T^(m)ZBased on the commutation rules XH=HZ; YH=−YH; and ZH=XH, any term of theform PQH, wherein P,Q are Pauli gates can be reduced to H P′i^(m)m∈□,wherein P′ is a Pauli gate.

Computing Environments

FIG. 9 and the following discussion are intended to provide a brief,general description of an exemplary computing environment in which thedisclosed technology may be implemented. Although not required, thedisclosed technology is described in the general context of computerexecutable instructions, such as program modules, being executed by apersonal computer (PC). Generally, program modules include routines,programs, objects, components, data structures, etc., that performparticular tasks or implement particular abstract data types. Moreover,the disclosed technology may be implemented with other computer systemconfigurations, including hand held devices, multiprocessor systems,microprocessor-based or programmable consumer electronics, network PCs,minicomputers, mainframe computers, and the like. The disclosedtechnology may also be practiced in distributed computing environmentswhere tasks are performed by remote processing devices that are linkedthrough a communications network. In a distributed computingenvironment, program modules may be located in both local and remotememory storage devices.

With reference to FIG. 9, an exemplary system for implementing thedisclosed technology includes a general purpose computing device in theform of an exemplary conventional PC 900, including one or moreprocessing units 902, a system memory 904, and a system bus 906 thatcouples various system components including the system memory 904 to theone or more processing units 902. The system bus 906 may be any ofseveral types of bus structures including a memory bus or memorycontroller, a peripheral bus, and a local bus using any of a variety ofbus architectures. The exemplary system memory 904 includes read onlymemory (ROM) 908 and random access memory (RAM) 910. A basicinput/output system (BIOS) 912, containing the basic routines that helpwith the transfer of information between elements within the PC 900, isstored in ROM 908.

As shown in FIG. 9, computer-executable instructions for RUS synthesisare stored in a memory portion 916 and includes instructions for, forexample, solving integer equations, evaluating and solving normequations, and random sampling for determination of r values. Inaddition, a memory portion 918 stores RUS circuit definitions obtainedusing the disclosed methods. Computer-executable instructions are alsostored for receiving rotation angles and precisions as well ascommunicating circuit definitions.

The exemplary PC 900 further includes one or more storage devices 930such as a hard disk drive for reading from and writing to a hard disk, amagnetic disk drive for reading from or writing to a removable magneticdisk, and an optical disk drive for reading from or writing to aremovable optical disk (such as a CD-ROM or other optical media). Suchstorage devices can be connected to the system bus 906 by a hard diskdrive interface, a magnetic disk drive interface, and an optical driveinterface, respectively. The drives and their associated computerreadable media provide nonvolatile storage of computer-readableinstructions, data structures, program modules, and other data for thePC 900. Other types of computer-readable media which can store data thatis accessible by a PC, such as magnetic cassettes, flash memory cards,digital video disks, CDs, DVDs, RAMs, ROMs, and the like, may also beused in the exemplary operating environment.

A number of program modules may be stored in the storage devices 930including an operating system, one or more application programs, otherprogram modules, and program data. Storage of quantum syntheses andinstructions for obtaining such syntheses can be stored in the storagedevices 930 as well as or in addition to the memory 904. A user mayenter commands and information into the PC 900 through one or more inputdevices 940 such as a keyboard and a pointing device such as a mouse.Other input devices may include a digital camera, microphone, joystick,game pad, satellite dish, scanner, or the like. These and other inputdevices are often connected to the one or more processing units 902through a serial port interface that is coupled to the system bus 906,but may be connected by other interfaces such as a parallel port, gameport, or universal serial bus (USB). A monitor 946 or other type ofdisplay device is also connected to the system bus 906 via an interface,such as a video adapter. Other peripheral output devices, such asspeakers and printers (not shown), may be included. In some cases, auser interface is display so that a user can input a circuit forsynthesis, and verify successful synthesis.

The PC 900 may operate in a networked environment using logicalconnections to one or more remote computers, such as a remote computer960. In some examples, one or more network or communication connections950 are included. The remote computer 960 may be another PC, a server, arouter, a network PC, or a peer device or other common network node, andtypically includes many or all of the elements described above relativeto the PC 900, although only a memory storage device 962 has beenillustrated in FIG. 9. The personal computer 900 and/or the remotecomputer 960 can be connected to a logical a local area network (LAN)and a wide area network (WAN). Such networking environments arecommonplace in offices, enterprise wide computer networks, intranets,and the Internet.

When used in a LAN networking environment, the PC 900 is connected tothe LAN through a network interface. When used in a WAN networkingenvironment, the PC 900 typically includes a modem or other means forestablishing communications over the WAN, such as the Internet. In anetworked environment, program modules depicted relative to the personalcomputer 900, or portions thereof, may be stored in the remote memorystorage device or other locations on the LAN or WAN. The networkconnections shown are exemplary, and other means of establishing acommunications link between the computers may be used.

With reference to FIG. 10, an exemplary system for implementing thedisclosed technology includes computing environment 1000, wherecompilation into braid pattern circuits is separated from the quantumprocessing that consumes the compiled circuits.

The environment includes a quantum processing unit 1002 and one or moremonitoring/measuring device(s) 1046. The quantum processor executesquantum circuits that are precompiled by classical compiler unit 1020utilizing one or more classical processor(s) 1010. The precompiledquantum circuits such as RUS circuits 1003 are downloaded into thequantum processing unit via quantum bus 1006.

With reference to FIG. 10, the compilation is the process of translationof a high-level description of a quantum algorithm into a sequence ofquantum circuits. Such high-level description may be stored, as the casemay be, on one or more external computer(s) 1060 outside the computingenvironment 1000 utilizing one or more memory and/or storage device(s)1062, then downloaded as necessary into the computing environment 1000via one or more communication connection(s) 1050. Alternatively, theclassical compiler unit 1020 is coupled to a classical processor 1010and an RUS compiler procedure library 1021 that contains some or allprocedures necessary to implement the methods described above as well asan RUS circuit library 1003 that stores compiled circuits.

Having described and illustrated the principles of our invention withreference to the illustrated embodiments, it will be recognized that theillustrated embodiments can be modified in arrangement and detailwithout departing from such principles. For instance, elements of theillustrated embodiment shown in software may be implemented in hardwareand vice-versa. Also, the technologies from any example can be combinedwith the technologies described in any one or more of the otherexamples. Alternatives specifically addressed in these sections aremerely exemplary and do not constitute all possible

FIG. 11 illustrates an alternative circuit 1100 that implements atwo-qubit unitary transformation of the form

$\begin{pmatrix}U & 0 \\0 & U^{\dagger}\end{pmatrix}\quad$

wherein U is a single qubit unitary 1130, Depending on a value of a flagbit b (established by a qubit 1121), the circuit 1100 implements atransformation of an input state of a qubit 1122 that is given by eitherU or U^(\). The resulting state is obtained at the output 1155, whereinthe output state is unentangled with all other qubits. The single-qubitunitary U1130 is of the form R_(z)(θ)R_(x)(β)R_(z)(−θ), wherein θ and βare real numbers. The circuit 1100 uses two ancilla qubits 1123, 1124initialized in 0 states.

The circuit 1100 consists of an initial preparation circuit 1110 thatproduces an Einstein-Podolsky-Rosen (EPR) state |00>+|11> which is thensubjected to quantum routing circuits 1115 and 1140 that permute part ofthe EPR state and the input state of the qubit 1122 depending on thevalue of bit b. In a “b=0” branch, the input state of the qubit 1122undergoes evolution by U and the remaining state |00>+|11> is aneigenstate of eigenvalue 1 of the tensor product operator U^(\) with U.In a “b=1” branch, the input state of the qubit 1122 undergoes evolutionby U^(\) and the remaining state |00>−|11> is an eigenstate ofeigenvalue 1 of the tensor product operator U with U.

The overall effect of the circuit 1100 is to achieve at the output 1155a transformation of the input that corresponds to U in case b=0 andU^(\) in case b=1. In either case, the 2 ancilla qubits 1123, 1124 areagain returned in the 0 state. As a core circuit 1130 can be executed inparallel, the circuit 1100 has the feature that its overall circuitdepth is no larger than the circuit depth of U, except for a constantadditive overhead due to the EPR preparation 1110 and computationthereof as well as the routing operations of quantum routing circuits1115, 1140.

With reference to FIG. 12, a circuit decomposition method 1200 forarbitrary unitary transformations over the cyclotomic field Q(ω) isdisclosed that uses at most 2 additional ancilla qubits. At 1202, aunitary is input that can act on one, two, three, or more qubits, and isnot limited to acting on a single qubit. At 1206, a selected unitary Uis embedded into a unitary W of larger size of the form:

$W = \begin{pmatrix}{\frac{\alpha}{2^{/2}}U} & {\overset{\_}{\beta}1_{2^{''}}} & {\overset{\_}{\gamma}1_{2^{''}}} & 0_{2^{''}} \\{\beta 1}_{2^{''}} & {{- \frac{\overset{\_}{\alpha}}{2^{/2}}}{U\dagger}} & 0_{2^{''}} & {\overset{\_}{\gamma}1_{2^{''}}} \\{\gamma 1}_{2^{''}} & 0_{2^{''}} & {{- \frac{\overset{\_}{\alpha}}{2^{/2}}}{U\dagger}} & {{- \overset{\_}{\beta}}1_{2^{''}}} \\0_{2^{''}} & {\gamma 1}_{2^{''}} & {- {\beta 1}_{2^{''}}} & {\frac{\alpha}{2^{/2}}U}\end{pmatrix}$

One convenient method of determine integer coefficients a, β, γ, δ at1204 is a method based on a Four Square Decomposition of integers whichis applicable for arbitrary matrices U over the cyclotomic field.Alternatively, methods solving norm equations over cyclotomic numberfields and subfields can be used, and in some examples, suitable methodsare based on particular properties of a selected U. Once the embeddingmatrix W is obtained at 1206, a Clifford+T factorization is obtainedusing methods for decomposition of unitary matrices over the ring ofintegers in Q(ω) at 1208.

In other examples, quantum circuits are defined by obtaining a fourtuple of integers so that a given rotation matrix U over the cyclotomicfield can be embedded into a unitary W over the ring of cyclotomicintegers. The rotation matrix U is embedded into the unitary W, and W isdecomposed using a suitable gate set, such as Clifford+T gates. In someexamples, an initial RUS circuit is defined based on a plurality ofancilla qubits, and subsequently re-synthesized so as to beimplementable with only 2 ancilla qubits.

In other examples, quantum circuits are defined to include two ancillaqubits and a control qubit so as to implement a RUS matrix for axialrotations with circuit depth equal to the circuit depth of the definingblock U, wherein a transformation associated with the RUS matrix isassociated with U or U^(\) based on a value of a control qubit. Acontrolled routing operation is arranged to couple an input state to aunitary operation implementing either U or U^(\) and a controlledpreparation operation creates one of two available EPR states dependingon whether an eigenstate of a tensor product of U with itself or atensor product of U with its inverse is required. The circuitdecomposition of U is lifted to provide a circuit for parallel executionof U and U^(\) and having the same T-depth as a single application of U.

In some examples, quantum circuits such as two-qubit circuits are basedon a plurality of gates selected from the group of Hadamard gates, CNOTgates, and T-gates selected in association with an arbitrary singlequbit rotation matrix U, wherein entries of the matrix U are real orcomplex numbers, and U corresponds to a sequence of axial rotations suchthat U=R_(z)(a)R_(x)(β)R_(z)(γ), wherein R_(z) denotes a rotation abouta z-axis and Rx denotes a rotation about an x-axis, wherein a, β, γ areEuler angles. Ancillary qubits and a primary qubit are coupled to theplurality of gates such that production of a first output state of thefirst ancillary qubit is associated with an output state of the primaryqubit that is associated with the rotation R_(z)(a), a second outputstate of the second ancillary qubit associated with an output state ofthe primary qubit that is associated with the rotation R_(x)(β and athird output state of the third ancillary qubit associated with anoutput state of the primary qubit that is associated with the rotationR_(z)(γ). In some examples, the first ancillary qubit and the primaryqubit are reused for production of the rotation R_(x)(β) and at leastone of the second and third ancillary qubits and the primary qubit isreused for production of the rotation R_(z)(γ). In other examples, thedecomposition of U into a sequence of axial rotations is based on Givensrotations.

Having described and illustrated the principles of the disclosedtechnology with reference to the illustrated embodiments, it will berecognized that the illustrated embodiments can be modified inarrangement and detail without departing from such principles. Forinstance, elements of the illustrated embodiments shown in software maybe implemented in hardware and vice-versa. Also, the technologies fromany example can be combined with the technologies described in any oneor more of the other examples. It will be appreciated that proceduresand functions such as those described with reference to the illustratedexamples can be implemented in a single hardware or software module, orseparate modules can be provided. The particular arrangements above areprovided for convenient illustration, and other arrangements can be used

1.-15. (canceled)
 16. A method of defining a quantum circuit,comprising: establishing a rational cyclotomic approximation of a targetsingle-qubit unitary to a requested precision; expanding the rationalcyclotomic approximation into a multi-qubit unitary that implements thetarget single-qubit unitary upon successful measurement; decomposing themulti-qubit unitary into a Clifford+T circuit; and defining aRepeat-Until-Success (RUS) circuit based on the decomposition.
 17. Themethod of claim 16, further comprising: establishing the rationalcyclotomic approximation of the target single-qubit unitary so as tosolve a required norm equation; and defining the multiple-qubit unitarybased on the rational cyclotomic approximation.
 18. The method of claim16, wherein the multi-qubit unitary is a multi-qubit unitary definedwith respect to at least one ancillary qubit and a primary qubit. 19.The method of claim 17, wherein the target unitary is an axial rotationand is approximated by z*/z wherein z is a cyclotomic integer; andmodifying z by randomly selecting at least one value of r∈

√{square root over (2)}] such that the norm equation is solvable for zreplaced by rz.
 20. The method of claim 19, wherein a single-qubitmatrix defined by z and r is of the form$\frac{1}{{\sqrt{2}}^{L}}\begin{pmatrix}{rz} & y \\{- y^{*}} & {r^{*}z^{*}}\end{pmatrix}$ and the norm equation is |y|²=2^(L)−|rz|², wherein L is apositive integer.
 21. The method of claim 20, wherein at least one valueof r is selected so as to boost the one-round probability of successp(r)=|rz|²/2^(L) of the RUS circuit.
 22. The method of claim 21, whereinthe probability of success is proportional to a square of a magnitude ofthe product of r and z.
 23. The method of claim 20, further comprisingdefining the multi-qubit unitary based on the single-qubit matrix. 24.The method of claim 23, further comprising expanding the single-qubitmatrix corresponding to the target single-qubit unitary into amulti-qubit unitary, defining the multi-qubit unitary as a Clifford+Tunitary by identifying the entangling two-qubit gates required forimplementation of the RUS circuit.
 25. The method of claim 24, furthercomprising decomposing the single-qubit matrix corresponding to thetarget single-qubit unitary into a product of axial rotations andimplementing the multi-qubit unitary corresponding to each axialrotation as a Clifford+T circuit obtained from a product g₃c′g₄, whereing₁, g₂, g₃, g₄ are Clifford gates, c is a T-code, and c′ is a decorationof c, and defining the two-qubit unitary as Λ(g₅)(Id

g₁)Lift(c′)(Id

g₂)Λ(g₆) .
 26. The method of claim 25, wherein the ancillary qubit or aplurality of qubits associated with the axial rotations are reused forthe implementation of at least one additional RUS circuit.
 27. Themethod of claim 24, further comprising decomposing the single-qubitmatrix corresponding to the target single-qubit unitary, wherein thetarget single-qubit unitary performs a rotation around an axis in thex-y plane; implementing the multi-qubit unitary corresponding to therotation around an axis in the x-y plane with a circuit obtained from acontrolled routing operation, wherein the controlled routing operationdirects an input state to a unitary operation implementing either U orU^(\) and prepares one out of two possible EPR states on at least twoancillary qubits.
 28. The method of claim 18, wherein the multi-qubitunitary is defined so as to be coupled to the ancillary qubits and theprimary qubit, such that measurement of the ancillary qubits can beassociated with success or failure of the multi-qubit circuit to producea primary qubit state corresponding to the target single-qubit unitary.29. The method of claim 28, further comprising defining a restoringcircuit that returns the output state of the primary qubit to an inputstate of the primary qubit if the ancillary qubits indicate failure ofthe multi-qubit circuit.
 30. A quantum circuit, comprising: amulti-qubit circuit based on a plurality of gates selected from thegroup of Hadamard gates, CNOT gates, and T-gates selected so as toimplement a rotation R based on a ratio z*/z, wherein z is a cyclotomicinteger; and at least one ancillary qubit and a primary qubit, coupledto the plurality of gates such that production of a first output stateof the ancillary qubits is associated with an output state of theprimary qubit that is associated with the rotation R.
 31. The quantumcircuit of claim 30, wherein the rotation R=R(θ), and z is selected suchthat |z*/z−e^(iθ)|<ε, wherein ε is a precision.
 32. The quantum circuitof claim 31, wherein a second output state of the ancillary qubits isassociated with an output state of the primary qubit that is notassociated with the rotation R(θ).
 33. The quantum circuit of claim 32,wherein a one-qubit circuit corresponding to the rotation R(θ) is aproduct circuit defined by g₃c′g₄, wherein g₁,g₂, g₃, g₄ are Cliffordgates, c is a T-code, and c′ is a decoration of c, and the multi-qubitunitary is Λ(g₅)(Id

g_(i))Lift(c′)(Id

g₂)Λ(g₆) .
 34. The quantum circuit of claim 33, further comprising arestoring circuit situated to be applied to the primary qubit if theancillary qubits are measured to be in the second state.
 35. A compilerfor defining a quantum circuit, comprising: a processor; and at leastone computer-readable storage medium having computer-executableinstructions for a method comprising: receiving a selected rotationangle and precision; selecting a cyclotomic integer z such that z*/z isassociated with the selected rotation angle within the selectedprecision; performing a random search to find values of r∈

[√{square root over (2)}] such that a norm equation (|y|²+|rz|²)/2^(L)=1is solvable for z=rz and y is a cyclotomic integer; defining a one-qubitunitary as ${\frac{1}{{\sqrt{2}}^{L}}\begin{pmatrix}{rz} & y \\{- y^{*}} & {r^{*}z^{*}}\end{pmatrix}};$ defining a multiple-qubit RUS circuit based on the onequbit unitary and a plurality of Clifford+T gates, the multiple-qubitRUS circuit including at least one ancillary qubit having an outputstate that is associated with realization of an output state of aprimary qubit that is associated with the selected rotation; coupling arestoring circuit so as to return the output state of the primary qubitto an input state if the at least one ancillary qubit is indicates thatthe output state of the primary qubit does not correspond to theselected rotation; and storing associated circuit definitions.